<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>空间分析-数据集泰森多边形</title>

    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.css">
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>

<script type="text/javascript" src="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.js"></script>
<script type="text/javascript" src="../../dist/iclient9-leaflet.min.js"></script>
<script type="text/javascript">
    var map, thiessenAnalystService, dsThiessenAnalystParameters, resultLayer,
            baseUrl = "http://support.supermap.com.cn:8090/iserver/services/map-changchun/rest/maps/长春市区图",
            serviceUrl = "http://support.supermap.com.cn:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst";
    map = L.map('map', {
        crs: L.CRS.NonEarthCRS({
            bounds: L.bounds([48.4, -7668.25], [8958.85, -55.58]),
            origin: L.point(48.4, -55.58)
        }),
        center: [-3375, 5105],
        maxZoom: 18,
        zoom: 1
    });
    L.supermap.tiledMapLayer(baseUrl, {noWrap: true})
            .addTo(map)
            .on("load", function () {
                thiessenAnalystProcess();
            });

    function thiessenAnalystProcess() {
        thiessenAnalystService = L.supermap.spatialAnalystService(serviceUrl);
        dsThiessenAnalystParameters = new SuperMap.DatasetThiessenAnalystParameters({
            dataset: "Factory@Changchun"
        });
        thiessenAnalystService.thiessenAnalysis(dsThiessenAnalystParameters, function (serviceResult) {
            resultLayer = L.geoJSON(serviceResult.result.regions, {weight: 2}).addTo(map);
        });
    }
</script>
</body>
</html>